using System;
using System.Collections.Generic;
using System.IO;
using Sce.PlayStation.Core;
using Sce.PlayStation.Core.Input;

using Nyanimals_UI;
using Sce.PlayStation.HighLevel.UI;

namespace Nyanimals
{    
	public class CMainMenuState : CBaseState
	{
        MainMenu menu;
        
        void ToWorld(object sender, TouchEventArgs e)
        {
            CStateMachine.Instance.ChangeState(new CLoadingState(CLoadingState.LoadType.LoadWorld));
        }
        void ToRace(object sender, TouchEventArgs e)
        {
            CStateMachine.Instance.ChangeState(new CLoadingState(CLoadingState.LoadType.LoadRace));
        }
        void ToExit(object sender, TouchEventArgs e)
        {
            CGame.Instance.Stop();      
        }
        
		public CMainMenuState ()
		{
		}
		
		public void Enter()
		{
            menu = new MainMenu(ToWorld, ToRace, ToExit);
            menu.SetWidgetLayout(LayoutOrientation.Horizontal);
            UISystem.SetScene(menu);            
		}
		
		public void Exit()
		{
            //menu.Visible = false;
            UISystem.SetScene(null);
		}
		
		public void Input()
		{
		}
		
		public void Update(float deltaTime)
		{
		}
		
		public void Render()
		{
		}
		
        
		public StateTypes GetStateType()
		{
			return StateTypes.MainMenu_State;
		}
        
	}
}

